package com.abl.controller.position;

import com.abl.common.security.annotation.ResC;
import com.abl.common.security.annotation.ResM;
import com.abl.controller.BaseController;
import com.abl.domain.model.Param;
import com.abl.domain.model.SRS;
import com.abl.service.position.PositionTableService;
import com.alibaba.fastjson2.JSONObject;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@ResC("商场定位系统（表格管理）")
@Tag(name = "商场定位系统（表格管理）")
@RestController
@RequestMapping("/position/area/table")
public class PositionTableController extends BaseController {

    @Autowired
    private PositionTableService positionTableService;

    @ResM("列表集合")
    @PostMapping({"/list"})
    public SRS<Object> list(@RequestBody Param<JSONObject> param) {
        return SRS.bySuccess(positionTableService.list(param));
    }

    @ResM("添加区域")
    @PostMapping({"/add"})
    public SRS<Object> add(@RequestBody Param<JSONObject> param) {
        return SRS.bySuccess(positionTableService.add(param));
    }

    @ResM("区域列表集合")
    @PostMapping({"/del"})
    public SRS<Object> del(@RequestBody Param<JSONObject> param) {
        return SRS.bySuccess(positionTableService.del(param));
    }

    @ResM("区域列表集合")
    @PostMapping({"/edit"})
    public SRS<Object> edit(@RequestBody Param<JSONObject> param) {
        return SRS.bySuccess(positionTableService.edit(param));
    }
}
